<!DOCTYPE>
<html>
<head>
    <title>index</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1">
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <script src="jquery-1.9.1.js" type="text/javascript"></script>
    <script>
        function testSubmit() {
            var url = $("#url").val();
            var type = $("#type").val();
            var paramsType = $("#paramsType").val();

            var options = {
                url : url,
                type: type,
                async: true,
                cache: false,
                timeout: 60000,
                dataType: "html",
                success: function (response) {
                    $("#result").html(response)
                }
            }
            if (paramsType != "parameter") {
                var params = $("#params").val();
                options.data = params;
                options.contentType = paramsType;
            }
            $.ajax(options);
        }

        function paramsTypeChanged(thiz) {
            var paramsType = $(thiz).val();
            if (paramsType != "parameter") {
                $("#paramsDiv").show();
            } else {
                $("#paramsDiv").hide();
            }
        }

        function setUrl(thiz) {
            $("#url").val($(thiz).val());
        }
    </script>
    <style type="text/css">
        body {
            font-size:12px;
        }
    </style>
</head>
<body>
<div>账户服务</div>
<div>版本:2017-09-12 v1</div>
<div style="margin-top: 10px;">
    <span>URL:</span>
    <input id="url" type="text" style="width: 200px;height: 30px;" value="/api/conf/platform/getAll">
    <select id="urlSelect" style="width: 200px;" onchange="setUrl(this);">
        <option value="">选择</option>
        <option value="/api/conf/platform/getAll">所有平台数据</option>
        <option value="/api/flush/flushPlatform">清除平台缓存</option>
        <option value="/api/flush/flushChannel">清除渠道缓存</option>
        <option value="/api/flush/flushBusiness">清除业务缓存</option>
        <option value="/api/flush/all">清除所有</option>
    </select>

</div>
参数:
<div id="paramsDiv" style="margin-top: 10px;">
    <textarea id="params" style="width: 300px;height: 100px;"></textarea>
</div>
<div style="margin-top: 10px;">
    <span>请求类型:</span>
    <select id="type" style="width: 150px;">
        <option value="POST">POST</option>
        <option value="GET">GET</option>
    </select>
</div>
<div style="margin-top: 10px;">
    <span>参数类型:</span>
    <select id="paramsType" style="width: 150px;" onchange="paramsTypeChanged(this);">
        <option value="application/json;charset=utf-8">application/json</option>
        <option value="parameter">parameter</option>
    </select>
</div>
结果:
<div id="result" style="width: 500px;height: 200px;border: 1px solid #f0e7e7; margin-top: 10px;overflow:auto;">

</div>
<br/>
<input type="button" id="btn" onclick="testSubmit();" style="width: 100px;height: 30px;" value="提交"/>

</body>
</html>